<?xml version="1.0" encoding="UTF-8"?>

<!--
    Document   : addProduct.xsl
    Created on : May 28, 2013, 9:01 PM
    Author     : TuPA
    Description:
        Purpose of transformation follows.
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="html"/>

    <xsl:variable name="brand" select="document('../XML/Brands.xml')"/>
 
    <xsl:template match="Catalogues">
        <h1>Add New Product</h1>
        <form id="formregister" method="POST" action="Product" enctype="multipart/form-data" onsubmit="return addNewProduct(this);">
            <table border="0">
                <tr>
                    <td id="text" style='font-size:18px'>Product Name(*)</td>
                    <td>
                        <label>
                            <input name="txtProductname" type="text" id="txtProductname" onchange="checkName(this.value)"/>
                            <br/>
                            <span id="idProductname" style="color:red"></span>
                        </label>
                    </td>
                </tr>
                <tr>
                    <td id="text" style='font-size:18px'>Sell Price(*)</td>
                    <td>
                        <label>
                            <input name="txtPrice" type="text" id="txtPrice" onchange="checkPrice(this.value)" />
                            <br/>
                            <span id="idPrice" style="color:red"></span>
                        </label>
                    </td>
                </tr>
                <tr>
                    <td id="text" style='font-size:18px'>Description(*)</td>
                    <td>
                        <label>
                            <textarea name="txtDescrip" cols="16" rows="5" style='width:500px' id="txtDescrip"></textarea>
                            <br/>
                            <span id="idDescrip" style="color:red"></span>
                        </label>
                    </td>
                </tr>
                <tr>
                    <td id="text" style='font-size:18px'>Image(*)</td>
                    <td>
                        <label>
                            <input type="file" name="txtImage" value="" id="txtImage" onchange="checkImage(this.value)"/>
                            <br/>
                            <span id="idImage" style="color:red"></span>
                        </label>
                    </td>
                </tr>
                <tr>
                    <td id="text" style='font-size:18px'>Category</td>
                    <td>
                        <label>
                            <select name="txtCatelog" type="text" id="txtCatelog" style='width:150px'>
                                <xsl:for-each select="Catalogue">
                                    <option>
                                        <xsl:value-of select="catalogName"/>
                                    </option>
                                </xsl:for-each>
                            </select>
                            <br/>
                            <span id="idCatelog" style="color:red"></span>
                        </label>
                    </td>
                </tr>
                <tr>
                    <td id="text" style='font-size:18px'>Brand</td>
                    <td>
                        <label>
                            <select name="txtBrand" type="text" id="txtBrand" style='width:150px'>
                                <xsl:for-each select="$brand//brand">
                                    <option>
                                        <xsl:value-of select="brandName"/>
                                    </option>
                                </xsl:for-each>
                            </select>
                            <br/>
                            <span id="idBrand" style="color:red"></span>
                        </label>
                    </td>
                </tr>
                <tr>
                    <td id="text" style='font-size:18px'>Quantity(*)</td>
                    <td>
                        <label>
                            <input name="txtNumber" type="text" id="txtNumber" onchange="checkNumber(this.value)"/>
                            <br/>
                            <span id="idNumber" style="color:red"></span>
                        </label>
                    </td>
                </tr>
                <tr>
                    <td id="text" style='font-size:18px'>Country(*)</td>
                    <td>
                        <label>
                            <input name="txtFrom" type="text" id="txtFrom" onchange="checkFrom(this.value)"/>
                            <br/>
                            <span id="idFrom" style="color:red"></span>
                        </label>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" >
                        <input name="btAction" type="submit" id="btSubmit" value="Add" style='margin-left: 400px; padding: 10px 15px; margin-right: 10px'/>
                        <input type="reset" value="Reset" id="btReset" style="padding: 10px"/>
                    </td>
                </tr>
            </table>
        </form>
    </xsl:template>

</xsl:stylesheet>
